import request from '@/utils/request'

// 查询学期评价列表
export function listComments(query) {
  return request({
    url: '/comments/comments/list',
    method: 'get',
    params: query
  })
}

// 查询学期评价详细
export function getComments(commentId) {
  return request({
    url: '/comments/comments/' + commentId,
    method: 'get'
  })
}

// 新增学期评价
export function addComments(data) {
  return request({
    url: '/comments/comments',
    method: 'post',
    data: data
  })
}

// 修改学期评价
export function updateComments(data) {
  return request({
    url: '/comments/comments',
    method: 'put',
    data: data
  })
}

// 删除学期评价
export function delComments(commentId) {
  return request({
    url: '/comments/comments/' + commentId,
    method: 'delete'
  })
}

// 获取当前老师下的所有学生的评价信息
export function listCommentsbyTeacher(teacherId) {
  return request({
    url: `/comments/comments/listByTeacherId/${teacherId}`,
    method: 'get'
  })
}

// 查询该老师名下的这个学期没有被评价的学生的信息
export function listNoComments(teacherId, termId) {
  return request({
    url: `/comments/comments/listNoComments/${teacherId}/${termId}`,
    method: 'get'
  })
}


// 查看学生自评
export function StidentEvaluation(studentId, commentTiime) {
  return request({
    url: `StudentEvaluation/getStudentEvaluation/${studentId}/${commentTiime}`,
    method: 'get'
  })
}

// 更新学生自评

export function UpdateEvaluation(date) {
  return request({
    url: `StudentEvaluation/updateStudentEvaluation`,
    method: 'put',
    data: date
  })
}


